class SweetPoto():
  def __init__(self):
    self.cookTime=0
    self.static="生的"
    self.condiments=[]
  def cook(self,time):
    #烤地瓜方法
    self.cookTime+=time
    if 0<=self.cookTime<3:
      self.static="生的"
    elif 3<=self.cookTime<5:
      self.static="半生不熟"
    elif 5<=self.cookTime<8:
      self.static="熟的"
    elif self.cookTime >=8:
      self.static="烤糊了"
  def addCondiments(self,condiment):
      self.condiments.append(condiment)
  def __str__(self):
    return  f'这个地⽠烤了{self.cookTime}分钟, 状态是{self.static}, 添加的调料有{self.condiments}\n'
  def __del__(self):
    print(f"{self}对象已经被删除")
digua1 = SweetPoto()
print(digua1)

digua2 = SweetPoto()
digua2.cook(2)
digua2.addCondiments("酱油")
print(digua2)
digua2.cook(12)
digua2.addCondiments("辣椒面")
print(digua2)
del digua2